<template>
    <div>
      <van-row>
        <van-nav-bar
            title="收货地址"
            fixed
            placeholder
            left-text="返回"
            @click-left="onCancel"
        >
          <template #left>
            <van-icon   color="black" size="22" name="arrow-left" />
          </template>
        </van-nav-bar>
        <van-col span="24">
          <van-address-list
              v-model="chosenAddressId"
              :list="list"
              default-tag-text="默认"
              @add="onAdd"
              @edit="onEdit"
          >
            <template #item-bottom>

            </template>
          </van-address-list>
        </van-col>
      </van-row>
    </div>
</template>

<script>
export default {
  name: "Address",
  data() {
    return {
      chosenAddressId: '1',
      list: [
        {
          id: '1',
          name: 'Herther',
          tel: '13000000000',
          address: '福建省厦门市集美区后溪镇孙版南路1251号',
          isDefault: true,
        },
        {
          id: '2',
          name: 'Herther',
          tel: '13000000000',
          address: '福建省厦门市集美区后溪镇孙版南路1251号',
          isDefault: false,
        }
      ],

    };
  },
  methods: {
    onAdd() {
      this.$toast('新增地址');
    },
    onEdit(item, index) {
        this.$router.replace("/editAddress")
    },
    onCancel(){
      this.$router.replace("/Info")
    }
  }
}
</script>

<style scoped>

</style>
